package cn.huas.dao.serviceImp;
/**
 * 信计团队
 * @version 1.0
 * 网址：http://www.huas.cn
 * E-mail：xieqingcheng@126.com ; txws1010@163.com
 * Copyright 2011 Hunan University of Arts and Science
 */
import java.util.ArrayList;
import java.util.List;

import cn.huas.dao.RecordDAO;
import cn.huas.dao.service.ScheduleManager;
import cn.huas.model.CourseRClass;
import cn.huas.model.Schedule;
import cn.huas.model.TeachersRCourse;
import cn.huas.modelVo.ArgsFlag;

public class ScheduleManagerImp implements ScheduleManager {
	private RecordDAO recordDAO;
	public RecordDAO getRecordDAO() {
		return recordDAO;
	}
	public void setRecordDAO(RecordDAO recordDAO) {
		this.recordDAO = recordDAO;
	} 
	
	/**
	 *  查询课程-班级关联表
	 *  @author xie
	 *  @return List<CourseRClass>
	 *  @param ArgsFlag argsFlag
	 */
	public List<CourseRClass> queryCourseRClass(ArgsFlag argsFlag){
		//try{
			//List<CourseRClass> list = recordDAO.queryCourseRClass(argsFlag);
			//return list;
		//}catch(Exception e){
		//	e.printStackTrace();
			return null;
	//	}
	}
	
	/**
	 *  通过课程id__查询教师-课程关联表
	 *  @author xie
	 *  @return List<TeachersRCourse>
	 *  @param ArgsFlag argsFlag
	 */
	public List<TeachersRCourse> queryTeachersRCourse(ArgsFlag argsFlag){
		List<TeachersRCourse> list = new ArrayList<TeachersRCourse>();
		try{
			List<CourseRClass> courrclasslist = recordDAO.queryCourseRClass(argsFlag);
			for(CourseRClass courrClass:courrclasslist){
				ArgsFlag args = new ArgsFlag();
				args.setFlag02(courrClass.getCourse().getCourse_id());
				List<TeachersRCourse> list1= recordDAO.queryTeachersRCourse(args);
				for(TeachersRCourse teaRCourse:list1){
					list.add(teaRCourse);
				}
			}
			return list;
		}catch(Exception e){
			e.printStackTrace();
			return null;
		}
	}
	
	public List<Schedule> querySchedule(ArgsFlag argsFlag) throws Exception {
		try{
			List<Schedule> list = recordDAO.querySchedule(argsFlag);
			return list;
		}catch(Exception e){
			e.printStackTrace();
			return null;
		}
	}
	public Boolean addSchedule(List<Schedule> list) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

}
